# -*- encoding:utf8 -*-
from openpyxl import Workbook,load_workbook
import io

def list2excel07(ls):
    byt=io.BytesIO()
    wb = Workbook()
    # dest_filename = 'export_book.xlsx'
    ws1 = wb.active
    ws1.title = "export_book"
    # for row in range(1, 40):
        # ws1.append(['中文','测试'])
    for row in ls:
        ws1.append(row)
    wb.save(byt)
    return byt.getvalue()

def excel07_2list(excel_content):
    """
    excel_content:excel的二进制流
    """
    f=io.BytesIO(excel_content)
    wb=load_workbook(f)
    ws = wb.active 
    ls=[]
    for row in ws.rows:  
        inls=[]
        for cell in row:
            inls.append(cell.value) 
        ls.append(inls)
    return ls

if __name__=='__main__':
    list2excel07([])